<?php
/**
 * Created by PhpStorm.
 * User: linvscode      工厂模式
 * Date: 2018/7/29
 * Time: 22:29
 */
namespace IMooc;

class Factory
{
    static function createDatabase()
    {
        $db = Database::getInstance();  //使用单例模式
        Register::set('db1', $db);      //注册对象
        return $db;
    }
}